require 'mail'

Mail.defaults do
  retriever_method :imap, :address    => "mail.xunlei.com",
                          :user_name  => 'chendawei',
                          :password   => 'ilikedwc',
                          :enable_ssl => false
end


m = Mail.first

puts m.from
puts m.subject
puts Mail.delete(m)
